*-------------------------------------------------------------------------------
* Price and Wasserman (2024), "The Summer Drop in Female Employment"
*
* Description: Load all stored estimation results in a given directory.
*-------------------------------------------------------------------------------

capture program drop load_estimates
program define load_estimates
	* User supplies a path relative to the "models" directory
	syntax, path(string)

	* Purge any estimates in memory
	quietly estimates clear

	* Get a list of .ster files in the given directory
	local flist : dir "$basepath/models/`path'/" files "*.ster"

	* Loop over .ster files
	foreach f of local flist {
		* Drop file extension
		local fstub `=substr("`f'", 1, length("`f'") - 5)'

		* Load estimates into working memory
		quietly estimates use "$basepath/models/`path'/`f'"
		quietly estimates store `fstub'
	}
end
